//package com.open.source.demo;
//
//import com.open.source.MqConstant;
//import com.open.source.kafka.delay.AbstractKafkaDelayConsumerListener;
//import com.open.source.kafka.delay.DelayLevel;
//import java.util.Date;
//import java.util.LinkedList;
//import lombok.extern.slf4j.Slf4j;
//import org.apache.kafka.clients.consumer.ConsumerRecord;
//import org.apache.kafka.common.header.Header;
//import org.springframework.stereotype.Component;
//
///**
// * @author ZonLen since on 2022/8/9 下午3:12
// */
//@Slf4j
//@Component
//public class DemoKafkaDelayConsumerListener extends AbstractKafkaDelayConsumerListener {
//
//  private final LinkedList<DelayLevel> partitionDelayLevel = new LinkedList<>();
//
//  public DemoKafkaDelayConsumerListener() {
//    partitionDelayLevel.addLast(DelayLevel.DELAY_LEV1);
//  }
//
//
//  @Override
//  public LinkedList<DelayLevel> delayLevels() {
//    return partitionDelayLevel;
//  }
//
//
//  @Override
//  public String delayTopic() {
//    return MqConstant.TAX_TOPIC_DELAY_DEMO;
//  }
//
//
//  @Override
//  public void delayDealWith(ConsumerRecord<String, String> record) {
//    final Header header = record.headers().headers("host-ip").iterator().next();
//    log.info("header {}={}", header.key(), new String(header.value()));
//    log.info("DelayConsumer curDate={}, sendDate={}, partition={}, offset={} ",
//        new Date(), new Date(record.timestamp()), record.partition(), record.offset());
//  }
//
//  @Override
//  protected void tryLastTime(ConsumerRecord<String, String> record) {
//    log.info("TryLastTime curDate={}, sendDate={}, partition={}, offset={} ",
//        new Date(), new Date(record.timestamp()), record.partition(), record.offset());
//  }
//
//
//}
